package com.indusfo.spc.reportForms.controller;


import com.indusfo.spc.reportForms.pojo.QualityAbnormal;
import com.indusfo.spc.reportForms.service.QualityAbnormalService;
import com.indusfo.spc.vo.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @ClassName QualityAbnormal
 * @Descriptionp 品质异常及处理
 * @Author louk
 * @Date 2020/2/7 13:31
 */
@Controller
@RequestMapping("qualityAbnormal")
public class QualityAbnormalController {

    @Resource
    QualityAbnormalService qualityAbnormalService;

    /**
     * 查询品质异常处理报表信息
     * @param qualityAbnormal
     * @return
     */
    @ResponseBody
    @RequestMapping("queryQualityAbnormaliInfo")
    public JSONObject queryQualityAbnormaliInfo(@RequestBody QualityAbnormal qualityAbnormal){

       return qualityAbnormalService.queryQualityAbnormaliInfo(qualityAbnormal);
    }

    @ResponseBody
    @RequestMapping("downloadQualityAbnormaliInfo")
    public void downloadQualityAbnormaliInfo(@RequestBody QualityAbnormal qualityAbnormal, HttpServletResponse res, HttpServletRequest request){
        qualityAbnormalService.downloadQualityAbnormaliInfo(qualityAbnormal,res,request);
    }
}
